/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements.  See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/


/*************************************************************************
 *\author: starlove
 *************************************************************************/
#ifndef __CC_PYTHON_IMPORT_O_PARTICLE_IMPL__
#define __CC_PYTHON_IMPORT_O_PARTICLE_IMPL__

#include "python_object_particle.h"

NS_CCPY_BEGIN
	/////////////////////////////////////////////////////////////////////
	PYCLASS_INIT_F(CPyParticle, "sCCParticle", "Python sCCParticle Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyParticle)
	PYCLASS_END_METHOD_DEF(CPyParticle)
	PYCLASS_BEGIN_GETSET_DEF(CPyParticle)
	PYCLASS_END_GETSET_DEF(CPyParticle)
	PYCLASS_IMP_INTERFACE(CPyParticle);

	CCNODE_OBJECT_WRAPPER_IMPL(CCParticleBatchNode, CPyParticleBatchNode)	

	PYCLASS_INIT_AND_BASE_2(CPyParticleBatchNode, CPyNode, CPyTextureProtocol, "CCParticleBatchNode", "Python CCParticleBatchNode Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyParticleBatchNode)
	PYCLASS_END_METHOD_DEF(CPyParticleBatchNode)
	PYCLASS_BEGIN_GETSET_DEF(CPyParticleBatchNode)
	PYCLASS_END_GETSET_DEF(CPyParticleBatchNode)
	PYCLASS_IMP_INTERFACE_NOINIT(CPyParticleBatchNode)	

	//CCNODE_OBJECT_WRAPPER_IMPL(CCParticleSystem, CPyParticleSystem)	

	PYCLASS_INIT_AND_BASE_2(CPyParticleSystem, CPyNode, CPyTextureProtocol, "CCParticleSystem", "Python CCParticleSystem Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyParticleSystem)
		PYCLASS_ADD_METHOD(CPyParticleSystem, addParticle)
		PYCLASS_ADD_METHOD(CPyParticleSystem, stopSystem)
		PYCLASS_ADD_METHOD(CPyParticleSystem, resetSystem)
		PYCLASS_ADD_METHOD(CPyParticleSystem, postStep)
		PYCLASS_ADD_METHOD(CPyParticleSystem, updateWithNoTime)
		PYCLASS_ADD_METHOD(CPyParticleSystem, initWithTotalParticles)
	PYCLASS_END_METHOD_DEF(CPyParticleSystem)
	PYCLASS_BEGIN_GETSET_DEF(CPyParticleSystem)
		PYCLASS_ADD_GETSET(CPyParticleSystem, Gravity)
		PYCLASS_ADD_GETSET(CPyParticleSystem, Speed)
		PYCLASS_ADD_GETSET(CPyParticleSystem, SpeedVar)
		PYCLASS_ADD_GETSET(CPyParticleSystem, TangentialAccel)
		PYCLASS_ADD_GETSET(CPyParticleSystem, TangentialAccelVar)
		PYCLASS_ADD_GETSET(CPyParticleSystem, RadialAccel)
		PYCLASS_ADD_GETSET(CPyParticleSystem, RadialAccelVar)
		PYCLASS_ADD_GETSET(CPyParticleSystem, RotationIsDir)
		PYCLASS_ADD_GETSET(CPyParticleSystem, StartRadius)
		PYCLASS_ADD_GETSET(CPyParticleSystem, StartRadiusVar)
		PYCLASS_ADD_GETSET(CPyParticleSystem, EndRadius)
		PYCLASS_ADD_GETSET(CPyParticleSystem, EndRadiusVar)
		PYCLASS_ADD_GETSET(CPyParticleSystem, RotatePerSecond)
		PYCLASS_ADD_GETSET(CPyParticleSystem, RotatePerSecondVar)
		PYCLASS_ADD_GETSET(CPyParticleSystem, BlendAdditive)
		PYCLASS_ADD_GETSET(CPyParticleSystem, StartSize)
		PYCLASS_ADD_GETSET(CPyParticleSystem, StartSizeVar)
		PYCLASS_ADD_GETSET(CPyParticleSystem, EndSize)
		PYCLASS_ADD_GETSET(CPyParticleSystem, EndSizeVar)
		PYCLASS_ADD_GETSET(CPyParticleSystem, StartColor)
		PYCLASS_ADD_GETSET(CPyParticleSystem, StartColorVar)
		PYCLASS_ADD_GETSET(CPyParticleSystem, EndColor)
		PYCLASS_ADD_GETSET(CPyParticleSystem, EndColorVar)
		PYCLASS_ADD_GETSET(CPyParticleSystem, StartSpin)
		PYCLASS_ADD_GETSET(CPyParticleSystem, StartSpinVar)
		PYCLASS_ADD_GETSET(CPyParticleSystem, EndSpin)
		PYCLASS_ADD_GETSET(CPyParticleSystem, EndSpinVar)
		PYCLASS_ADD_GETSET(CPyParticleSystem, EmissionRate)
		PYCLASS_ADD_GETSET(CPyParticleSystem, TotalParticles)
		PYCLASS_ADD_GETSET(CPyParticleSystem, PositionType)
		PYCLASS_ADD_GETSET(CPyParticleSystem, EmitterMode)
		PYCLASS_ADD_GETSET(CPyParticleSystem, AutoRemoveOnFinish)
		PYCLASS_ADD_GET(CPyParticleSystem, isFull)
		PYCLASS_ADD_SET(CPyParticleSystem, Scale)
		PYCLASS_ADD_SET(CPyParticleSystem, Rotation)
		PYCLASS_ADD_SET(CPyParticleSystem, ScaleX)
		PYCLASS_ADD_SET(CPyParticleSystem, ScaleY)    
		PYCLASS_ADD_GET(CPyParticleSystem, isActive)
	PYCLASS_END_GETSET_DEF(CPyParticleSystem)
	PYCLASS_IMP_INTERFACE_NOINIT(CPyParticleSystem)
	CPyParticleSystem::CPyParticleSystem(){}

	int CPyParticleSystem::__init__(CPyParticleSystem *pySelf, PyObject *args, PyObject *kwds)
	{
		if( !args )
			return 0;
		static char* kwlist[] = {"plistFile", "numberOfParticles", NULL};
		char *plistFile = NULL;
		unsigned int numberOfParticles = 0;
		if (!PyArg_ParseTupleAndKeywords(args,kwds,"|sI",kwlist, &plistFile, &numberOfParticles))
			return 0;
		if(plistFile)
		{
			pySelf->setCCObject(CCParticleSystem::create(plistFile));
			//CC_METHOD_WRAPPER_GETER_RINT(CCParticleSystem *, CPyParticleSystem, initWithFile, bool, plistFile);
			return 0;
		}
		if(numberOfParticles)
		{
			pySelf->setCCObject(CCParticleSystem::createWithTotalParticles(numberOfParticles));
			//CC_METHOD_WRAPPER_GETER_RINT(CCParticleSystem *, CPyParticleSystem, initWithTotalParticles, bool, numberOfParticles);
			return 0;
		}
		return 0;
	}
		
	PYCLASS_METHOD_IMPL(CPyParticleSystem, initWithTotalParticles)
	{
		unsigned int numberOfParticles = 0;
		if( !PyArg_ParseTuple(pyArgs, "I", &numberOfParticles) )
			Py_RETURN_FALSE;
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, initWithTotalParticles, bool, numberOfParticles);
		Py_RETURN_BOOL(v);
	}

	PYCLASS_METHOD_IMPL(CPyParticleSystem, addParticle)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, addParticle, bool);
		Py_RETURN_BOOL(v);
	}
	
	PYCLASS_METHOD_IMPL(CPyParticleSystem, stopSystem)
	{
		CC_METHOD_WRAPPER_SETER(CCParticleSystem *, CPyParticleSystem, stopSystem);
		Py_RETURN_NONE;
	}

	PYCLASS_METHOD_IMPL(CPyParticleSystem, resetSystem)
	{
		CC_METHOD_WRAPPER_SETER(CCParticleSystem *, CPyParticleSystem, resetSystem);
		Py_RETURN_NONE;
	}

	PYCLASS_METHOD_IMPL(CPyParticleSystem, postStep)
	{
		CC_METHOD_WRAPPER_SETER(CCParticleSystem *, CPyParticleSystem, postStep);
		Py_RETURN_NONE;
	}

	PYCLASS_METHOD_IMPL(CPyParticleSystem, updateWithNoTime)
	{
		CC_METHOD_WRAPPER_SETER(CCParticleSystem *, CPyParticleSystem, updateWithNoTime);
		Py_RETURN_NONE;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, isFull)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, isFull, bool);
		Py_RETURN_BOOL(v);
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, isActive)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, isActive, bool);
		Py_RETURN_BOOL(v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, Scale)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setScale, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, Rotation)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setRotation, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, ScaleX)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setScaleX, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, ScaleY) 
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setScaleY, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, Gravity)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getGravity, CCPoint);
		return (PyObject *)CPyPoint::create(v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, Gravity)
	{
		if(!PyObject_TypeCheck(pyValue, CPyClassBase::GetTypeObject<CPyPoint>()))
			return 0;
		CPyPoint *pt = (CPyPoint *)pyValue;
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setGravity, pt->getCCObject());
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, Speed)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getSpeed, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, Speed)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setSpeed, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, SpeedVar)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getSpeedVar, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, SpeedVar)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setSpeedVar, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, TangentialAccel)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getTangentialAccel, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, TangentialAccel)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setTangentialAccel, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, TangentialAccelVar)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getTangentialAccelVar, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, TangentialAccelVar)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setTangentialAccelVar, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, RadialAccel)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getRadialAccel, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, RadialAccel)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setRadialAccel, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, RadialAccelVar)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getRadialAccelVar, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, RadialAccelVar)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setRadialAccelVar, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, RotationIsDir)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getRotationIsDir, bool);
		Py_RETURN_BOOL(v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, RotationIsDir)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setRotationIsDir, pyValue == Py_True);
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, StartRadius)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getStartRadius, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, StartRadius)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setStartRadius, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, StartRadiusVar)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getStartRadiusVar, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, StartRadiusVar)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setStartRadiusVar, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, EndRadius)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getEndRadius, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, EndRadius)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setEndRadius, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, EndRadiusVar)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getEndRadiusVar, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, EndRadiusVar)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setEndRadiusVar, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, RotatePerSecond)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getRotatePerSecond, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, RotatePerSecond)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setRotatePerSecond, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, RotatePerSecondVar)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getRotatePerSecondVar, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, RotatePerSecondVar)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setRotatePerSecondVar, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, BlendAdditive)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, isBlendAdditive, bool);
		Py_RETURN_BOOL(v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, BlendAdditive)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setBlendAdditive, pyValue == Py_True);
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, AutoRemoveOnFinish)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, isAutoRemoveOnFinish, bool);
		Py_RETURN_BOOL(v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, AutoRemoveOnFinish)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setAutoRemoveOnFinish, pyValue == Py_True);
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, StartSize)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getStartSize, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, StartSize)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setStartSize, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, StartSizeVar)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getStartSizeVar, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, StartSizeVar)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setStartSizeVar, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, EndSize)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getEndSize, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, EndSize)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setEndSize, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, EndSizeVar)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getEndSizeVar, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, EndSizeVar)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setEndSizeVar, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, StartColor)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getStartColor, ccColor4F);
		return (PyObject *)CPyColor4F::create(v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, StartColor)
	{
		if(!PyObject_TypeCheck(pyValue, CPyClassBase::GetTypeObject<CPyColor4F>()))
			return 0;
		CPyColor4F *pt = (CPyColor4F *)pyValue;
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setStartColor, pt->getCCObject());
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, StartColorVar)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getStartColorVar, ccColor4F);
		return (PyObject *)CPyColor4F::create(v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, StartColorVar)
	{
		if(!PyObject_TypeCheck(pyValue, CPyClassBase::GetTypeObject<CPyColor4F>()))
			return 0;
		CPyColor4F *pt = (CPyColor4F *)pyValue;
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setStartColorVar, pt->getCCObject());
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, EndColor)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getEndColor, ccColor4F);
		return (PyObject *)CPyColor4F::create(v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, EndColor)
	{
		if(!PyObject_TypeCheck(pyValue, CPyClassBase::GetTypeObject<CPyColor4F>()))
			return 0;
		CPyColor4F *pt = (CPyColor4F *)pyValue;
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setEndColor, pt->getCCObject());
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, EndColorVar)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getEndColorVar, ccColor4F);
		return (PyObject *)CPyColor4F::create(v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, EndColorVar)
	{
		if(!PyObject_TypeCheck(pyValue, CPyClassBase::GetTypeObject<CPyColor4F>()))
			return 0;
		CPyColor4F *pt = (CPyColor4F *)pyValue;
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setEndColorVar, pt->getCCObject());
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, StartSpin)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getStartSpin, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, StartSpin)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setStartSpin, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, StartSpinVar)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getStartSpinVar, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, StartSpinVar)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setStartSpinVar, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, EndSpin)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getEndSpin, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, EndSpin)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setEndSpin, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, EndSpinVar)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getEndSpinVar, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, EndSpinVar)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setEndSpinVar, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, EmissionRate)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getEmissionRate, float);
		return Py_BuildValue("f", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, EmissionRate)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setEmissionRate, PyFloat_AsDouble(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, TotalParticles)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getTotalParticles, unsigned int);
		return Py_BuildValue("I", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, TotalParticles)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setTotalParticles, PyLong_AsUnsignedLong(pyValue));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, PositionType)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getPositionType, tCCPositionType);
		return Py_BuildValue("i", static_cast<int>(v));
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, PositionType)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setPositionType, static_cast<tCCPositionType>(PyLong_AsLong(pyValue)));
		return 0;
	}

	PYCLASS_GET_IMPL(CPyParticleSystem, EmitterMode)
	{
		CC_METHOD_WRAPPER_GETER(CCParticleSystem *, CPyParticleSystem, getEmitterMode, int);
		return Py_BuildValue("i", v);
	}

	PYCLASS_SET_IMPL(CPyParticleSystem, EmitterMode)
	{
		CC_METHOD_WRAPPER_SETER_RINT(CCParticleSystem *, CPyParticleSystem, setEmitterMode, PyLong_AsLong(pyValue));
		return 0;
	}

	
	//CCNODE_OBJECT_WRAPPER_IMPL(CCParticleSystemQuad, CPyParticleSystemQuad)	

	PYCLASS_INIT_AND_BASE(CPyParticleSystemQuad, CPyParticleSystem, "CCParticleSystemQuad", "Python CCParticleSystemQuad Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyParticleSystemQuad)
		PYCLASS_ADD_METHOD(CPyParticleSystemQuad, initIndices)
		PYCLASS_ADD_METHOD(CPyParticleSystemQuad, initTexCoordsWithRect)
		PYCLASS_ADD_METHOD(CPyParticleSystemQuad, setDisplayFrame)
		PYCLASS_ADD_METHOD(CPyParticleSystemQuad, setBatchNode)
		PYCLASS_ADD_METHOD(CPyParticleSystemQuad, listenBackToForeground)
	PYCLASS_END_METHOD_DEF(CPyParticleSystemQuad)
	PYCLASS_BEGIN_GETSET_DEF(CPyParticleSystemQuad)
	PYCLASS_END_GETSET_DEF(CPyParticleSystemQuad)
	PYCLASS_IMP_INTERFACE_NOINIT(CPyParticleSystemQuad)
	CPyParticleSystemQuad::CPyParticleSystemQuad(){}
	int CPyParticleSystemQuad::__init__(CPyParticleSystemQuad *pySelf, PyObject *args, PyObject *kwds)
	{
		if( !args )
			return 0;
		static char* kwlist[] = {"plistFile", "numberOfParticles", NULL};
		char *plistFile = NULL;
		unsigned int numberOfParticles = 0;
		if (!PyArg_ParseTupleAndKeywords(args,kwds,"|sI",kwlist, &plistFile, &numberOfParticles))
			return 0;
		if(plistFile)
		{
			pySelf->setCCObject(CCParticleSystemQuad::create(plistFile));
			//CC_METHOD_WRAPPER_GETER_RINT(CCParticleSystemQuad *, CPyParticleSystemQuad, initWithFile, bool, plistFile);
			return 0;
		}
		if(numberOfParticles)
		{
			pySelf->setCCObject(CCParticleSystemQuad::createWithTotalParticles(numberOfParticles));
			//CC_METHOD_WRAPPER_GETER_RINT(CCParticleSystemQuad *, CPyParticleSystemQuad, initWithTotalParticles, bool, numberOfParticles);
			return 0;
		}
		return 0;
	}

	PYCLASS_METHOD_IMPL(CPyParticleSystemQuad, initIndices)
	{
		CC_METHOD_WRAPPER_SETER(CCParticleSystemQuad *, CPyParticleSystemQuad, initIndices);
		Py_RETURN_NONE;
	}

	PYCLASS_METHOD_IMPL(CPyParticleSystemQuad, initTexCoordsWithRect)
	{
		PyObject *pyRect = NULL;
		if( !PyArg_ParseTuple(pyArgs, "O", &pyRect) )
			Py_RETURN_NONE;
		if(!PyObject_TypeCheck(pyRect, CPyClassBase::GetTypeObject<CPyRect>()))
			Py_RETURN_NONE;
		CPyRect *rt = (CPyRect *)pyRect;
		CC_METHOD_WRAPPER_SETER(CCParticleSystemQuad *, CPyParticleSystemQuad, initTexCoordsWithRect, rt->getCCObject());
		Py_RETURN_NONE;
	}

	PYCLASS_METHOD_IMPL(CPyParticleSystemQuad, setDisplayFrame)
	{
		PyObject *pySpr = NULL;
		if( !PyArg_ParseTuple(pyArgs, "O", &pySpr) )
			Py_RETURN_NONE;
		if(!PyObject_TypeCheck(pySpr, CPyClassBase::GetTypeObject<CPySpriteFrame>()))
			Py_RETURN_NONE;
		CPySpriteFrame *spr = (CPySpriteFrame *)pySpr;
		CC_METHOD_WRAPPER_SETER(CCParticleSystemQuad *, CPyParticleSystemQuad, setDisplayFrame, (CCSpriteFrame *)spr->getCCObject());
		Py_RETURN_NONE;
	}

	PYCLASS_METHOD_IMPL(CPyParticleSystemQuad, setBatchNode)
	{
		PyObject *pybn = NULL;
		if( !PyArg_ParseTuple(pyArgs, "O", &pybn) )
			Py_RETURN_NONE;
		if(!PyObject_TypeCheck(pybn, CPyClassBase::GetTypeObject<CPyParticleBatchNode>()))
			Py_RETURN_NONE;
		CPyParticleBatchNode *bn = (CPyParticleBatchNode *)pybn;
		CC_METHOD_WRAPPER_SETER(CCParticleSystemQuad *, CPyParticleSystemQuad, setBatchNode, (CCParticleBatchNode *)bn->getCCObject());
		Py_RETURN_NONE;
	}

	PYCLASS_METHOD_IMPL(CPyParticleSystemQuad, listenBackToForeground)
	{
		PyObject *pyo = NULL;
		if( !PyArg_ParseTuple(pyArgs, "O", &pyo) )
			Py_RETURN_NONE;
		if(!PyObject_TypeCheck(pyo, CPyClassBase::GetTypeObject<CPyCCObject>()))
			Py_RETURN_NONE; 
		CPyCCObject *o = (CPyCCObject *)pyo;
		CC_METHOD_WRAPPER_SETER(CCParticleSystemQuad *, CPyParticleSystemQuad, listenBackToForeground, o->getCCObject());
		Py_RETURN_NONE;
	}

#define PARTICLE_SAMPLE_IMPL(type_name, def, name, doc)\
	PYCLASS_INIT_AND_BASE(CPy##type_name, CPyParticleSystemQuad, name, doc);\
	PYCLASS_BEGIN_METHOD_DEF(CPy##type_name)\
	PYCLASS_END_METHOD_DEF(CPy##type_name)\
	PYCLASS_BEGIN_GETSET_DEF(CPy##type_name)\
	PYCLASS_END_GETSET_DEF(CPy##type_name)\
	PYCLASS_IMP_INTERFACE_NOINIT(CPy##type_name)\
	CPy##type_name::CPy##type_name(){}\
	int CPy##type_name::__init__(CPy##type_name *pySelf, PyObject *args, PyObject *kwds)\
	{\
		if( !args )\
			return 0;\
		static char* kwlist[] = {"numberOfParticles", NULL};\
		unsigned int numberOfParticles = 0;\
		if (!PyArg_ParseTupleAndKeywords(args,kwds,"|I",kwlist, &numberOfParticles))\
			return 0;\
		if(!numberOfParticles)\
			numberOfParticles = def;\
		pySelf->setCCObject(CC##type_name::createWithTotalParticles(numberOfParticles));\
		return 0;\
	}\

	PARTICLE_SAMPLE_IMPL(ParticleFire		, 250,	"CCParticleFire"		, "Python CCParticleFire Object");
	PARTICLE_SAMPLE_IMPL(ParticleFireworks	, 1500, "CCParticleFireworks"	, "Python CCParticleFireworks Object");
	PARTICLE_SAMPLE_IMPL(ParticleSun		, 350,	"CCParticleSun"			, "Python CCParticleSun Object");
	PARTICLE_SAMPLE_IMPL(ParticleGalaxy		, 200,	"CCParticleGalaxy"		, "Python CCParticleGalaxy Object");
	PARTICLE_SAMPLE_IMPL(ParticleFlower		, 250,	"CCParticleFlower"		, "Python CCParticleFlower Object");
	PARTICLE_SAMPLE_IMPL(ParticleMeteor		, 150,	"CCParticleMeteor"		, "Python CCParticleMeteor Object");
	PARTICLE_SAMPLE_IMPL(ParticleSpiral		, 500,	"CCParticleSpiral"		, "Python CCParticleSpiral Object");
	PARTICLE_SAMPLE_IMPL(ParticleExplosion	, 700,	"CCParticleExplosion"	, "Python CCParticleExplosion Object");
	PARTICLE_SAMPLE_IMPL(ParticleSmoke		, 200,	"CCParticleSmoke"		, "Python CCParticleSmoke Object");
	PARTICLE_SAMPLE_IMPL(ParticleSnow		, 700,	"CCParticleSnow"		, "Python CCParticleSnow Object");
	PARTICLE_SAMPLE_IMPL(ParticleRain		, 1000,	"CCParticleRain"		, "Python CCParticleRain Object");

NS_CCPY_END

#endif